<template>
    <div class="das">
        <img class="img" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=379183260,2740999994&fm=26&gp=0.jpg" alt="">
        <div class="dapai">
            <p>大牌拼团</p>
            <div class="dapai_nei" :data=tableData v-for="(v,index) in data" :key="index">
                <div>
                    <img class="nei_img" :src="v.list_img" alt="">
                    <p class="nei_name">{{v.list_name}}</p>
                    <p class="nei_pin">已拼{{v.list_num}}件</p>
                    <p class="nei_pinprice">拼团价：￥{{v.list_pinprice}}</p>
                    <p class="nei_price">单买价￥{{v.list_price}}</p>
                     <!-- <router-link class="nei_btn" to="/info?id=">去拼团</router-link> -->
                     <button class="nei_btn" @click="info(v.id)">马上拼团</button>
                </div>
            </div>
            <div class="dapai_kong"></div>
        </div>
        <p>到底啦！！！</p>
    </div>
</template>

<script>
export default {
  data () {
    return {
      tableData: {},
      data: ''
    }
  },

  // 列表展示
  created () {
    let t = this
    this.$axios({
      url: '/shop'
    }).then(function (res) {
      t.data = res.data.data
      console.log(t.data)
    })
  },

  // 内容展示
  methods: {
    info (id) {
      var that = this
      this.$axios({
        url: '/info?id=' + id,
        data: {
          id: id
        }
      }).then(function (res) {
        var code = res.data.code
        var data = res.data.data
        console.log(data)
        if (code === '1001') {
          alert('详情展示')
          that.$router.push({
            name: 'info',
            params: {
              id: id
            }
          })
        }
      })
    }
  }
}
</script>

<style lang="">
.nei_btn{
    float: right;
    margin-top: -70px;
    margin-right: 20px;
    border-radius: 10px;
    width: 70px;
    height: 30px;
    color: white;
    border:1px solid white;
    background-color: red;
}
.nei_price{
    color: rgb(161, 161, 161);
    width: 90px;
    font-size: 12px;
    margin-left: 110px;
    margin-top: -10px;
    /* background-color: aqua; */
}
.nei_pinprice{
    /* background-color: aqua; */
    color: red;
    width: 120px;
    font-size: 13px;
    margin-left: 102px;
    margin-top: -5px;
}
.nei_pin{
    font-size: 12px;
    color: white;
    width: 70px;
    height: 20px;
    background-color: rgb(226, 120, 112);
    margin-left: 110px;
    margin-top: -10px;
    border-radius: 10px;
    text-align: center;
}
.nei_name{
    font-size: 15px;
    /* background-color: antiquewhite; */
    margin-left: 110px;
    text-align: left;
    padding-top: 10px;
}
.nei_img{
    width: 80px;
    height: 80px;
    border-radius: 10px;
    float: left;
    margin-top: 10px;
    margin-left: 10px;
}
.dapai_kong{
    height: 20px;
}
.dapai_nei{
    width: 370px;
    height: 100px;
    background-color: rgb(255, 255, 255);
    margin-left: 15px;
    box-shadow: 0px 0px 1px 1px rgb(212, 212, 212);
    border-radius: 5px;
}
.dapai{
    width: 400px;
    background-color: rgb(233, 233, 233);
    margin-top: -20px;
}
.img{
    width: 400px;
    height: 170px;
}
.das{
    width: 400px;
    /* border: 1px solid rgb(0, 0, 0); */
}
</style>
